﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EMS20.Help
{
    using EMS20.Common;
    using EMS20.Entity;
    using EMS20.BusinessLogicLayer;

    public class WebBasePage : System.Web.UI.Page
    {
        protected override void OnPreInit(EventArgs e)
        {
            if (Session[Kits.Entity]==null)
            {
                if (Request.Cookies[Kits.CookieId]==null)
                {
                    Response.Redirect("/Login/Login.html");
                }
                else
                {
                    string cookieId = Request.Cookies[Kits.CookieId].Value.ToString();
                    UserInfoEntity entity = UserInfo_BLLSub.Get_UserInfoEntity(int.Parse(cookieId));
                    Session[Kits.Entity] = entity;
                }
            }

            base.OnPreInit(e);
        }
    }
}
